Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix null-pointer exception in error handling of RunAndWait #256

Merged
merged 1 commit into from
Dec 2, 2016

Conversation

tgross
Copy link
Contributor

@tgross tgross commented Dec 1, 2016

For #255

Cmd.Process.Wait does not guarantee that the ProcessState struct it returns is non-nil if the error it returns is non-nil, because we might have an invalid PID or a waitpid syscall error (ECHILD or EINTR).

We'll check ProcessState struct first b/c it might have the process error code and this is going to be the common case, but if not then we'll bubble-up the error. Expanded test coverage for invalid and pruned an unused error handling branch.

cc @jasonpincin @misterbisson

`Cmd.Process.Wait` does not guarantee that the `ProcessState` struct it returns
is non-nil if the error it returns is non-nil, because we might have an invalid
PID or a `waitpid` syscall error (ECHILD or EINTR).

We'll check ProcessState struct first b/c it might have the process error code
and this is going to be the common case, but if not then we'll bubble-up the
error. Expanded test coverage for invalid and pruned an unused error handling
branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant